<template>
	<view style="width: 99%;">
		<uni-table :border="true">
			<uni-tr>
				<uni-th> id </uni-th>
				<uni-th> 时间 </uni-th>
				<uni-th> 客户姓名 </uni-th>
				<uni-th> 余额 </uni-th>
				<uni-th> 积分 </uni-th>
				<uni-th> 代金券 </uni-th>
				<uni-th> 备注 </uni-th>
				<uni-th> 操作人 </uni-th>
			</uni-tr>
			<uni-tr v-for="(item,index) in memberbalancelog" :key="index">
				<uni-td> {{item.id}}</uni-td>
				<uni-td> {{item.datetime}}</uni-td>
				<uni-td> {{item.member_name}}</uni-td>
				<uni-td> {{item.balancenumber}}</uni-td>
				<uni-td> {{item.pointsnumber}}</uni-td>
				<uni-td> {{item.vouchernumber}}</uni-td>
				<uni-td> {{item.remark}}</uni-td>
				<uni-td> {{item.operater_name}}</uni-td>
			</uni-tr>
		</uni-table>
	</view>
</template>

<script>
	import {
		postrequest
	} from '../../common/apis.js';

	export default {
		name: "balanceLog",
		data() {
			return {
				page: 1,
				pagesize: 20,
				memberbalancelog: {},
			};
		},
		mounted() {
			this.getmemberbalancelog()
		},
		methods: {
			getmemberbalancelog(item) {
				this.memberbalancelog = []
				this.currentmemberinfo = item
				console.log(item)
				let data = {
					username: uni.getStorageSync('username'),
					password: uni.getStorageSync('password'),
					member_id: 0,
					page: 1,
					pagesize: this.pagesize
				}
				let url = 'https://www.jsyufang.com/yixun/api/getmemberbalancelog/index.asp'
				let errmessage = '获取会员余额日志接口调用失败'
				postrequest(url, data, errmessage, true)
					.then((res) => {
						console.log(res.data.data)
						this.memberbalancelog = res.data.data
						this.total = res.data.total
					})
			},
		}
	}
</script>

<style>

</style>